﻿
// Copyright © 2009 Mehdi Golchin. All rights reserved.

namespace TinyMceWrapper.Configuration
{

    #region [ Imports ]

    using System.Configuration;

    #endregion

    public sealed class TinyMceDisplayMode : ConfigurationElement
    {

        #region [ Local Fields ]

        private static readonly ConfigurationProperty NameProperty = new ConfigurationProperty("name", typeof(string), null,
            ConfigurationPropertyOptions.IsKey | ConfigurationPropertyOptions.IsRequired);

        private static readonly ConfigurationProperty OptionsProperty = new ConfigurationProperty("options", typeof(TinyMceOptionCollection));

        private static ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection();

        #endregion

        #region [ Constructors ]

        static TinyMceDisplayMode()
        {
            properties.Add(NameProperty);
            properties.Add(OptionsProperty);
        }

        #endregion

        #region  [ Public Properties ]

        [ConfigurationProperty("name", IsKey = true, IsRequired = true)]
        public string Name
        {
            get { return (string)this[NameProperty]; }
            set { this[NameProperty] = value; }
        }

        [ConfigurationProperty("options")]
        public TinyMceOptionCollection Options
        {
            get { return (TinyMceOptionCollection)this[OptionsProperty]; }
        }

        #endregion

        #region [ Override Members ]

        protected override ConfigurationPropertyCollection Properties
        {
            get { return properties; }
        }

        #endregion

    }

}
